#define YEALINK_DEV_NAME	"yealink_w1dl"
#define VENDOR_ID			0x6993
#define PRODUCT_ID			0xB001
#define IFACE_SUBCLASS		0x0000
#define IFACE_PROTOCOL		0x0000

#define WRITES_IN_FLIGHT	8

#define to_yealink_dev(d) container_of(d, struct usb_yealink, kref)

/* Commands for the Phone */
#define	CMD_LIGHT_STATUS	0x05

struct usb_yealink {
	struct usb_device		*udev;					/* the usb device for this device */
	struct usb_interface	*interface;				/* the interface for this device */
	struct semaphore		limit_sem;				/* limiting the number of writes in progress */
	struct usb_anchor		submitted;				/* in case we need to retract our submissions */
	int						errors;					/* the last request tanked */
	spinlock_t				err_lock;				/* lock for errors */
	struct kref				kref;
	struct mutex			io_mutex;				/* synchronize I/O with disconnect */
	int						number_end_points;
	size_t					writesize;				/* size of the interrupt in packet */

	unsigned char			*int_buffer;			/* the buffer to receive data */
	size_t					int_size;				/* the size of the receive buffer */
	__u8					int_endpointAddr;		/* the address of the interrupt in endpoint */

	int						int_pipe;				/* pipe for the interrupt in packet */
	int						int_interval;			/* interrupt interval from endpoint*/
	struct urb				*int_urb;				/* urb for the interrupt in packet */
	struct snd_packet		*int_packet;			/* interrupted data packet */

	int						ctrl_pipe;				/* pipe for the control packet */
	struct urb				*ctrl_urb;				/* urb for the control packet */
	struct snd_packet		*ctrl_packet;			/* control data packet */
	struct usb_ctrlrequest	*ctrlrequest;			/* usb control request */
};

struct snd_packet {
	u8	cmd;		/* command type */
	u8	size;		/* length of the effective data */
	u16	offset;		/* offset address */
	u8	data[59];	/* effective data */
	s8	sum;		/* check sum */
} __attribute__ ((packed));

